<html>
<head><meta charset="utf-8"><title>rendering of empty range diagnostic · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rendering.20of.20empty.20range.20diagnostic.html">rendering of empty range diagnostic</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="241150581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rendering%20of%20empty%20range%20diagnostic/near/241150581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manmeet Singh <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rendering.20of.20empty.20range.20diagnostic.html#241150581">(Jun 02 2021 at 13:44)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">et</span><span class="w"> </span><span class="n">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">5</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>in this code rust analyzers gives diagnostic <code>Syntax Error: expected SEMICOLON</code>  at start and end (line 2 col 6)<br>
how is it supposed to be rendered<br>
<a href="/user_uploads/4715/E3_B7QA0fsjqzLZsPQ716Xrz/image.png">emacs</a>  just increases end by one<br>
and <a href="/user_uploads/4715/qgfeHAzdmcgjE0Cyj62Jowuz/image.png">vscode snaps it to closest word boundary?</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/E3_B7QA0fsjqzLZsPQ716Xrz/image.png" title="emacs"><img src="/user_uploads/4715/E3_B7QA0fsjqzLZsPQ716Xrz/image.png"></a></div><div class="message_inline_image"><a href="/user_uploads/4715/qgfeHAzdmcgjE0Cyj62Jowuz/image.png" title="vscode snaps it to closest word boundary?"><img src="/user_uploads/4715/qgfeHAzdmcgjE0Cyj62Jowuz/image.png"></a></div>



<a name="241150937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rendering%20of%20empty%20range%20diagnostic/near/241150937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manmeet Singh <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rendering.20of.20empty.20range.20diagnostic.html#241150937">(Jun 02 2021 at 13:47)</a>:</h4>
<p>sorry if it is offtopic</p>



<a name="241151052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rendering%20of%20empty%20range%20diagnostic/near/241151052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rendering.20of.20empty.20range.20diagnostic.html#241151052">(Jun 02 2021 at 13:48)</a>:</h4>
<p>Emacs seems more correct here</p>



<a name="241151200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rendering%20of%20empty%20range%20diagnostic/near/241151200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manmeet Singh <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rendering.20of.20empty.20range.20diagnostic.html#241151200">(Jun 02 2021 at 13:49)</a>:</h4>
<p>this is what I am doing, cursor position (+/-) 6 pixel <a href="/user_uploads/4715/1t_BlWV3-mT3j2TOS6B8EDJq/image.png">image.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/1t_BlWV3-mT3j2TOS6B8EDJq/image.png" title="image.png"><img src="/user_uploads/4715/1t_BlWV3-mT3j2TOS6B8EDJq/image.png"></a></div>



<a name="241152644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rendering%20of%20empty%20range%20diagnostic/near/241152644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rendering.20of.20empty.20range.20diagnostic.html#241152644">(Jun 02 2021 at 13:59)</a>:</h4>
<p>rust itself increases the end by 1 in console error messages</p>



<a name="241154014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rendering%20of%20empty%20range%20diagnostic/near/241154014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Manmeet Singh <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rendering.20of.20empty.20range.20diagnostic.html#241154014">(Jun 02 2021 at 14:09)</a>:</h4>
<p>then it is easy choice :D</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>